package com.example.usermanagement.publisher;

import com.example.usermanagement.events.LiukaStopApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Service;

@Service
public class ApplicationStopPush implements ApplicationEventPublisherAware {

    private ApplicationEventPublisher applicationEventPublisher;

    @Override
    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        this.applicationEventPublisher = applicationEventPublisher;
    }

    public void pushStop(Long flowPackageUSerId){
        applicationEventPublisher.publishEvent(new LiukaStopApplicationEvent(this,flowPackageUSerId));
    }
}
